import 'package:dio/dio.dart';
import 'package:tencent_im_sdk_plugin_example/utils/config.dart';

Future<Response<Map<String, dynamic>>> appRequest({
  String? method = 'get',
  Map<String, dynamic>? params,
  required String path,
  dynamic data,
}) async {
  BaseOptions options = BaseOptions(
    baseUrl: Config.smsLoginHttpBase,
    method: method,
    sendTimeout: 6000,
    queryParameters: params,
  );
  return await Dio(options).request<Map<String, dynamic>>(
    path,
    data: data,
    queryParameters: params,
  );
}
